/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */

.frames [role="list"] {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.frames [role="list"] [role="listitem"] {
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  column-gap: 0.5em;
  flex-direction: row;
  align-items: center;
  margin: 0;
  max-width: 100%;
  flex-wrap: wrap;
  line-height: 1.5rem;
}

.frames [role="list"] [role="listitem"] * {
  user-select: none;
}

.frames .badge {
  flex-shrink: 0;
  margin-right: 4px;
}

.frames .location {
  font-weight: normal;
  margin: 0;
  flex-grow: 1;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  /* Trick to get the ellipsis at the start of the string */
  text-overflow: ellipsis;
  direction: rtl;
  text-align: right;
}

.call-stack-pane .location-async-cause {
  color: var(--theme-comment);
}

.theme-light .call-stack-pane .frames .location {
  color: var(--theme-comment);
  padding-right: 10px;
}

:root.theme-dark .frames .location {
  color: var(--theme-body-color);
  opacity: 0.6;
}

.frames .title {
  text-overflow: ellipsis;
  overflow: hidden;
  padding-left: 10px;
}

.call-stack-pane .frames [role="list"] [role="listitem"]:hover,
.call-stack-pane .frames [role="list"] [role="listitem"]:focus {
  background-color: var(--theme-toolbar-background-alt);
}

.call-stack-pane .frames [role="list"] [role="listitem"]:hover .location-async-cause,
.call-stack-pane .frames [role="list"] [role="listitem"]:focus .location-async-cause {
  background-color: var(--theme-body-background);
}

.theme-dark .frames [role="list"] [role="listitem"]:focus,
.theme-dark .frames [role="list"] [role="listitem"]:focus .async-label,
.theme-dark .frames [role="list"] [role="listitem"]:focus .async-label {
  background-color: var(--theme-tab-toolbar-background);
}

.frame-description {
  width: 100%;
  display: flex;
}
.frames [role="list"] [role="listitem"].selected .frame-description {
  background-color: var(--theme-selection-background);
  color: white;
}

.frames [role="list"] [role="listitem"].selected i.annotation-logo svg path {
  fill: white;
}

:root.theme-light .frames [role="list"] [role="listitem"].selected .location,
:root.theme-dark .frames [role="list"] [role="listitem"].selected .location {
  color: white;
}

.frames .show-more-container {
  display: flex;
  min-height: 24px;
  padding: 4px 0;
}

.frames .show-more {
  text-align: center;
  padding: 8px 0px;
  margin: 7px 10px 7px 7px;
  border: 1px solid var(--theme-splitter-color);
  background-color: var(--theme-tab-toolbar-background);
  width: 100%;
  font-size: inherit;
  color: inherit;
}

.frames .show-more:hover {
  background-color: var(--theme-toolbar-background-hover);
}

.frames .img.annotation-logo {
  margin-inline-end: 4px;
  background-color: currentColor;
}

/*
 * We also show the library icon in locations, which are forced to RTL.
 */
.frames .location .img.annotation-logo {
  margin-inline-start: 4px;
}

/* Some elements are added to the DOM only to be printed into the clipboard
   when the user copy some elements. We don't want those elements to mess with
   the layout so we put them outside of the screen
*/
.frames .clipboard-only {
  position: absolute;
  left: -9999px;
}

.call-stack-pane [role="listitem"] .location-async-cause {
  height: 20px;
  line-height: 20px;
  color: var(--theme-icon-dimmed-color);
  display: block;
  z-index: 4;
  position: relative;
  padding-left: 17px;
  width: 100%;
  pointer-events: none;
}

.call-stack-pane [role="listitem"] .location-async-cause::after {
  content: " ";
  position: absolute;
  left: 0;
  z-index: -1;
  height: 30px;
  top: 50%;
  width: 100%;
  border-top: 1px solid var(--theme-tab-toolbar-background);
}

.call-stack-pane .async-label {
  z-index: 1;
  background-color: var(--theme-body-background);
  padding: 0 3px;
  display: inline-block;
}

.accordion .call-stack-pane ._content,
.accordion .breakpoints-pane ._content {
  border-radius: 0 0 0 0;
}

.accordion .call-stack-pane ._header,
.accordion .scopes-pane ._header {
  border-top: 1px solid var(--theme-tab-background);
}
